From 31d366d44797ab5d52f6f085e923a8cd9f1f4ad1 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 3 Nov 2006 04:56:42 +0000 Subject: [PATCH] API * forcing the rc_timestamp index (to safeguard myself any harm from domas) --- includes/api/ApiQueryRecentChanges.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 6ed0d4bb19..e086b50a66 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -45,8 +45,8 @@ class ApiQueryRecentChanges extends ApiQueryBase { if (!is_null($hide)) { $hide = array_flip($hide); - if(isset ($hide['anons']) && isset ($hide['liu'])) - $this->dieUsage( "Both 'anons' and 'liu' cannot be set at the same time", 'hide' ); + if (isset ($hide['anons']) && isset ($hide['liu'])) + $this->dieUsage("Both 'anons' and 'liu' cannot be set at the same time", 'hide'); $this->addWhereIf('rc_minor = 0', isset ($hide['minor'])); $this->addWhereIf('rc_bot = 0', isset ($hide['bots'])); $this->addWhereIf('rc_user != 0', isset ($hide['anons'])); @@ -80,6 +80,7 @@ class ApiQueryRecentChanges extends ApiQueryBase { } $this->addOption('LIMIT', $limit +1); + $this->addOption('USE INDEX', 'rc_timestamp'); $data = array (); $count = 0; @@ -93,7 +94,7 @@ class ApiQueryRecentChanges extends ApiQueryBase { } $vals = $this->addRowInfo('rc', $row); - if($vals) + if ($vals) $data[] = $vals; } $db->freeResult($res); @@ -164,7 +165,7 @@ class ApiQueryRecentChanges extends ApiQueryBase { protected function getExamples() { return array ( - 'api.php?action=query&list=recentchanges', + 'api.php?action=query&list=recentchanges' ); } -- 2.20.1